﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Areas/Admin/Views/Shared/AdminSite.Master" Inherits="System.Web.Mvc.ViewPage<List<MensUnoShop.Models.Product>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	ProductList
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<script type="text/javascript" language="javascript">
//    function GetSpecList(pdguid) {
//        var jsonstring = { "pdguid": pdguid };
//        $.ajax({
//            type: "GET",
//            traditional: true,
//            url: "/Admin/Product/SpecListJson/" + pdguid,
//            data: jsonstring,
//            dataType: "json",
//            success: function (data) {
//                if (data != null) {
//                    var htmldata = "<tr>";
//                    $.each(data, function (key, val) {                        
//                        htmldata += "<td align='center' style='text-align: center' valign='middle'>" + val.TITLE + "</td>";
//                        htmldata += "<td align='center' style='text-align: center' valign='middle'>" + val.STOCK + "</td>";
//                        htmldata += "</tr>";
//                    });
//                    
//                    $("#aaa").html(htmldata);
//                }
//            }
//        });
//    }
</script>

<div id="main-content" class="hastable">
	<div class="title title-spacing">
		<h2>商品列表</h2>
					
	</div>

    <input type="button" value="新增商品" onclick="javascript:location.href='/Admin/Product/Product/0?mkguid=<%:ViewData["mkguid"] %>'" />
    <input type="button" value="賣場列表" onclick="javascript:history.back();" />
    <table cellspacing="0">
    <thead>
		<tr>                    
			<td style="width:100px">商品標籤</td>
			<td style="width:100px">商品大圖</td>
            <td style="width:100px">商品小圖</td>
            <%--<td style="width:100px"></td>--%>
            <td style="width:100px"></td>
		</tr>
	</thead>
    <%if (Model != null){%>
        <tbody>
    <%foreach (var item in Model)
    {  %>
        <tr>                   
            <td align="center" style="text-align: center" valign="middle"><%:item.TITLE%></td>
            <td><img src="<%:item.PICBIG%>" /></td>
            <td align="center" style="text-align: center" valign="middle"><img src="<%:item.PICSMALL%>" /></td>
            <%--<td><a id="Product" name="Product" href="/Admin/Product/Product/<%:item.PDGUID %>">商品明細</a></td>--%>
            <td align="center" style="text-align: center" valign="middle"><a id="Spec" name="Spec" href="/Admin/Product/SpecList/<%:item.PDGUID %>">規格列表</a></td>
            <%--<td align="center" style="text-align: center" valign="middle"><a id="Spec" name="Spec" onclick="GetSpecList('<%:item.PDGUID %>')">規格列表</a></td>--%>
        </tr>
    <%} %>
    </tbody>
    <%} %>
    </table>
           
    <br/><br/>　
</div>

        

<%--        <div id="spectlist" class="hastable">
        <table cellspacing="0">
            <thead>
				<tr>
					<td style="width:100px">規格標籤</td>
					<td style="width:100px">庫存量</td>
				</tr>
			</thead>
            <%if (Model != null){%>
            <tbody id="aaa"></tbody>
            <%} %>
            </table>
        </div>--%>

</asp:Content>
